package com.entity;

import com.group.PurOrderAddGroup;
import com.group.PurOrderModifyGroup;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.math.BigDecimal;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PurOrder {
    private Integer oid;//采购订单id
    @NotBlank(groups = PurOrderAddGroup.class, message = "采购单号不能为空")
    private String ordernum;//订货单号
    @Valid
    @NotNull(message = "供应商不能为空")
    private Supplier supplier;//供应商
    @NotBlank(groups = PurOrderAddGroup.class, message = "订货日期不能为空")
    private String orderdate;//订货日期
    @NotBlank(groups =PurOrderAddGroup.class, message = "要求交期不能为空")
    private String demanddelivery;//要求交期
    private BigDecimal summoney;//合计（该订单下所有商品之和）
    @NotBlank(groups =PurOrderAddGroup.class, message = "交货方式不能为空")
    private String deliverytype;//交货方式 送货/邮寄
    private String orderstatus;//订单状态（是否入库）
    private String notes;//备注
    private String createdate;//创建订单时间
    private Integer isdelete;//是否删除

    @Valid
    @NotNull(message = "商品不能为空")
    private PurGoods purGoods;//采购的商品信息
    @NotBlank(groups = PurOrderModifyGroup.class, message = "单位不能为空")
    private String productUnit;//单位
    private BigDecimal perprice;//采购单价
    @NotNull(groups = PurOrderModifyGroup.class, message = "采购数量不能为空")
    private Integer amount;//采购数量
    private BigDecimal taxrate;//税率（%）
    private BigDecimal mtsum;//价税合计
    private Integer storagenum;//入库数量
    private BigDecimal paid;//已付款金额
    private BigDecimal unpaid;//未付款金额
    @NotBlank(groups = PurOrderModifyGroup.class, message = "付款日期不能为空")
    private String paydate;//付款日期
    private String paytype;//付款方式
    @NotBlank(groups = PurOrderModifyGroup.class, message = "付款状态不能为空")
    private String paystatus;//付款状态

    private BigDecimal invoiced;//已开发票金额
    private BigDecimal uninvoice;//未开金额
    @NotBlank(groups = PurOrderModifyGroup.class, message = "开票日期不能为空")
    private String sinvicedate;//入库开票日期
    @NotBlank(groups = PurOrderModifyGroup.class, message = "票种不能为空")
    private String tickettype;//入库票种
    @NotBlank(groups = PurOrderModifyGroup.class, message = "发票号不能为空")
    private String invoicenum;//入库发票号
    @NotBlank(groups = PurOrderModifyGroup.class, message = "开票状态不能为空")
    private String invoicestatus;//开票状态

}
